<?php

namespace app\widgets;

use yii\base\Widget;
use yii\helpers\Html;

class EditorWidget extends widget
{
    public $message;

    /**
     * 应该包含小部件的属性
     */
    public function init()
    {
        parent::init();
        if ($this->message === null) {
            $this->message = 'Welcome User';
        } else {
            $this->message = 'Welcome ' . $this->message;
        }
    }
    /**
     * 应该包含小部件的渲染结果
     */
    public function run()
    {
        //return Html::encode($this->message);
        //exit('dddddd');
        $assign = [];
        return $this->render('editor', $assign);
    }
}
